import java.util.Stack;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: lv
 * Date: 2023-03-12
 * Time: 19:36
 */
public class Solution {
    public static boolean IsPopOrder(int[] pushA, int[] popA){
        Stack<Integer> stack=new Stack<>();
        int j=0;//遍历popA
        for (int i = 0; i < pushA.length; i++) {
            stack.push(pushA[i]);

            while(j<popA.length && !stack.empty() && stack.peek()==popA[j]){
                stack.pop();
                j++;
            }
        }
        return stack.empty();
    }

    public static void main(String[] args) {

        int[] pushA = new int[0];
        int[] popA = new int[0];
        IsPopOrder(pushA,popA);
    }
}
